#pragma once

#include "globalnotification_global.h"
#include <QObject>
#include <QVariantMap>

class GLOBALNOTIFICATION_EXPORT GlobalNotification : public QObject
{
    Q_OBJECT
public:
	static GlobalNotification* defaultCenter();
	void postNotification(const QString name = QString(), const QObject* sender = nullptr, QVariantMap* userInfo = nullptr);
	int addObserver(QObject* receiver, const char* method, const QString& name = QString(), const QObject* sender = nullptr);
	int removeObserver(const QObject* receiver, const QString& name = QString(), const QObject* sender = nullptr);
    ~GlobalNotification();


private:
	GlobalNotification(QObject* parent = nullptr);
    QMap<QString, QObject*> m_senderMap;
  
};
